package com.leonzx.base.config.quartz.job;

import com.google.gson.Gson;
import com.leonzx.base.config.quartz.BaseJob;
import com.leonzx.base.entity.system.User;
import com.leonzx.base.utils.PermissionUtils;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;

/**
 * 张勇
 * 2018-7-3
 */
public class UserReflash implements BaseJob {
    protected final Gson gson = new Gson();
    @Override
    public void execute(JobExecutionContext context) throws JobExecutionException {
        User user =gson.fromJson((String) context.getMergedJobDataMap().get("user"),User.class) ;
        PermissionUtils.reflashPermission(user);
    }
}
